import 'package:backend.core/core/domain/entities/api/app_store/api_app_store_transaction_revocation_reason.dart';
import 'package:backend.core/core/domain/entities/app_store/app_store_transaction_revocation_reason.dart';

abstract class CreateApiAppStoreTransactionRevocationReasonFromInternalOne {
  ApiAppStoreTransactionRevocationReason call({
    required AppStoreTransactionRevocationReason revocationReason,
  });
}

class CreateApiAppStoreTransactionRevocationReasonFromInternalOneImpl
    implements CreateApiAppStoreTransactionRevocationReasonFromInternalOne {
  const CreateApiAppStoreTransactionRevocationReasonFromInternalOneImpl();

  @override
  ApiAppStoreTransactionRevocationReason call({
    required AppStoreTransactionRevocationReason revocationReason,
  }) {
    switch (revocationReason) {
      case AppStoreTransactionRevocationReason.issueWithinApp:
        return ApiAppStoreTransactionRevocationReason.issueWithinApp;
      case AppStoreTransactionRevocationReason.otherReason:
        return ApiAppStoreTransactionRevocationReason.otherReason;
    }
  }
}
